package com.its.oa.system.userRole.dao.impl;

import java.util.List;
import com.its.oa.dao.base.ItsHibernateDaoSupport;
import com.its.oa.model.Role;
import com.its.oa.model.User;
import com.its.oa.model.UserRole;
import com.its.oa.system.userRole.dao.UserRoleDao;

public class UserRoleDaoImpl extends ItsHibernateDaoSupport implements UserRoleDao{

	public void addUserRole(User user, List<Role> roleList) {
		for (Role role : roleList) {
			UserRole ur = new UserRole();
			ur.setUser(user);
			ur.setRole(role);
			getHibernateTemplate().save(ur);
		}
		
	}

}
